package com.orange.protoTypePatterns.shallowCopyToImplement;

import lombok.Data;

/**
 * @Description: 测试用列
 */
@Data
public class User implements Cloneable{
    private User friend;

    @Override
    public User clone() {
        try {
            User clone = (User) super.clone();

            // TODO: 复制此处的可变状态，这样此克隆就不能更改初始克隆的内部项
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}
